home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
pluginy Firefox
/
3006
/
3006.xpi
/
chrome
/
dwhelper.jar
/
content
/
convert-log.xul
< prev
next >
Wrap
Extensible Markup Language
|
2010-01-15
|
3KB
|
83 lines
<?xml version="1.0"?>
<!-- *****************************************************************************
* Copyright (c) 2006-2009 Michel Gutierrez. All Rights Reserved.
****************************************************************************** -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://dwhelper/skin/dwhelper.css" type="text/css"?>
<?xml-stylesheet href="chrome://dwhelper/content/bindings.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://dwhelper/locale/dwhelper.dtd" >
<window id="dwhelper-convert-log"
title="&title.conversion-log;"
flex="1"
onload="onLoad()"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
>
<script type="application/x-javascript"
src="chrome://dwhelper/content/dwhutil.js" />
<script><![CDATA[
var Util=Components.classes["@downloadhelper.net/util-service;1"]
.getService(Components.interfaces.dhIUtilService);
var logFile=Util.getProfileDir();
logFile.append("cvhelper.log");
function onLoad() {
loadLog();
}
function loadLog() {
var logPanel=document.getElementById("dwhelper-conv-log-data");
while(logPanel.firstChild)
logPanel.removeChild(logPanel.firstChild);
if(logFile.exists()) {
var stream = Components.classes['@mozilla.org/network/file-input-stream;1'].
createInstance(Components.interfaces.nsIFileInputStream);
stream.init(logFile,1,0,false);
var scriptableStream = Components.classes['@mozilla.org/scriptableinputstream;1'].createInstance(Components.interfaces.nsIScriptableInputStream);
scriptableStream.init(stream);
var fileSize = scriptableStream.available();
var fileContents = scriptableStream.read(fileSize);
scriptableStream.close();
stream.close();
var logData=document.createTextNode(fileContents);
logPanel.appendChild(logData);
}
}
function clearLog() {
if(logFile.exists())
logFile.remove(false);
loadLog();
}
]]>
</script>
<vbox flex="1">
<box flex="1" style="overflow: auto;background-color: White;">
<html:textarea id="dwhelper-conv-log-data" style="" flex="1" readonly="true"/>
</box>
<hbox style="text-align: right;">
<spacer flex="1"/>
<button label="&button.convert-log.clear;" oncommand="clearLog()"/>
<button label="&button.convert-log.refresh;" oncommand="loadLog()"/>
<button label="&button.convert-log.close;" oncommand="window.close()"/>
</hbox>
</vbox>
</window>